package com.zhinong.mapper;

import com.zhinong.entity.Order;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartMapper {
    List<Order> selectOrdersByUserId(String userId);
    void updateProductQuantity(@Param("productId") String productId, @Param("change") Integer change);
    void updateProductSelection(@Param("productId") String productId, @Param("selected") Boolean selected);
    void updateStoreSelection(@Param("storeId") String storeId, @Param("selected") Boolean selected);
    void updateProductsSelectionByStore(@Param("storeId") String storeId, @Param("selected") Boolean selected);
    Double calculateTotalAmount(String userId);
    Integer calculateCartCount(String userId);
}